package com.mixsmart.commonweb.bean.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.mixsmart.commonweb.bean.ICreateTime;
import com.mixsmart.commonweb.bean.IPKStringBean;

/**
 * 附件表
 * @author lmq
 * @version 1.0
 * @since JDK1.6以上
 * <br />
 * 2016年7月22日
 */
@Entity
@Table(name="t_c_attachment")
public class TCAttachment implements IPKStringBean, ICreateTime {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3196285457241366424L;

	private String id;
	
	/**
	 * 文件名称
	 */
	private String fileName;
	
	/**
	 * 文件路径（相对路径）
	 */
	private String filePath;
	
	/**
	 * 文件类型
	 */
	private String fileType;
	
	/**
	 * 文件后缀;如:gif,doc等
	 */
	private String fileSuffix;
	
	/**
	 * 文件大小（单位：byte）
	 */
	private long fileSize;
	
	/**
	 * 上传文件的用户ID（上传附件者 ）
	 */
	private String userId;
	
	/**
	 * 附件类型；（如：流程附件；消息附件等）
	 */
	private String attType;
	
	/**
	 * 文件上传时间
	 */
	private Date createTime;
	
	public TCAttachment() {

	}
	
	public TCAttachment(String fileName, String filePath, String fileType, String fileSuffix, 
			long fileSize, String userId, String attType) {
		this.fileName = fileName;
		this.filePath = filePath;
		this.fileType = fileType;
		this.fileSuffix = fileSuffix;
		this.fileSize = fileSize;
		this.userId = userId;
		this.attType = attType;
	}

	@Id
	@Column(name="id", length=50)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name="file_name", length=127, nullable=false)
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	@Column(name="file_path", length=127, nullable=false)
	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	@Column(name="file_type", length=127)
	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	@Column(name="file_suffix", length=127)
	public String getFileSuffix() {
		return fileSuffix;
	}

	public void setFileSuffix(String fileSuffix) {
		this.fileSuffix = fileSuffix;
	}

	@Column(name="file_size", nullable=false)
	public long getFileSize() {
		return fileSize;
	}

	public void setFileSize(long fileSize) {
		this.fileSize = fileSize;
	}

	@Column(name="user_id", length=50, nullable=false)
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@Column(name="att_type", length=50)
	public String getAttType() {
		return attType;
	}

	public void setAttType(String attType) {
		this.attType = attType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time", nullable=false, updatable=false)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
}
